package com.woniu.scss.controller;

import com.woniu.common.utils.ResponseData;
import com.woniu.scss.dto.ReturnProductTypeDto;
import com.woniu.scss.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductTypeController {
    @Autowired
    private ProductTypeService productTypeService;
    @GetMapping("/queryAllProductType")
    public ResponseData<?> queryAllProductType() {
        return productTypeService.queryAllProductType();
    }
    @PostMapping("/addNewChild")
    public ResponseData<?> addNewChild(@RequestBody ReturnProductTypeDto param) throws InterruptedException {
       return productTypeService.addNewChild(param);
    }
    @PostMapping("/updateType")
    public ResponseData<?> updateType(@RequestBody ReturnProductTypeDto param) throws InterruptedException {
        return productTypeService.updateType(param);
    }
}
